<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--MD5工具类-->
    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.js"></script>
</head>
<body>

<div>
    <form action="#" method="post">
        <p>
            <span>用户名：</span><input type="text" id="username" name="username" required>
        </p>
        <p>
            <span>密码：</span><input type="password" id="password" name="password" required>
        </p>

        <button type="submit" onclick="aaa()">提交</button>
    </form>
</div>

<script>
    'use strict';
    function aaa(){
        let uname = document.getElementById('username');
        let pwd = document.getElementById('password');
        console.log(uname.value);
        console.log(pwd.value);
        //MD5算法
        pwd.value = md5(pwd.value);
        console.log(pwd.value);
        // pwd.value = '************';
    }


</script>

</body>
</html>